FROM golang:1.24-alpine AS builder

ENV GO111MODULE=on \
    GOPROXY=https://goproxy.cn,direct \
    CGO_ENABLED=0

RUN mkdir /app

ADD . /app

WORKDIR /app

RUN go build -o canal main.go


FROM alpine:latest

COPY --from=builder /app/canal /app/canal

WORKDIR /app

CMD ["/app/wj-mall-sync"]